import React, { Fragment } from 'react'
import {
  View,
  Animated,
  StyleSheet,
  Text,
  LayoutAnimation,
  InteractionManager,
  TouchableOpacity,
  findNodeHandle,
  Dimensions,
  Easing
} from 'react-native'
import { ScaleS, ScaleT, IS_IOS, WIDTH, ONE_PIXEL } from 'src/utils/ScreenUtil'

/* redux */
import { connect } from 'react-redux'
import { getCurrentPosition } from '../../../store/actions/landmark'
import {
  UPDATE_JOB_DETAIL_TYPE,
  INIT_JOB_DETAIL_TYPE,
  UPDATE_POSITION_DISTANCE_TYPE
} from './store/type'
import {
  DO_REQUEST_JOB_DETAIL_ACTION,
  DO_REQUEST_JOB_COLLECT_ACTION,
  DO_REQUEST_JOB_UNCOLLECT_ACTION
} from './store/action'
import { UPDATE_IM } from '@store/actions/im'

import BasePage from 'src/pageP/base/base-page/index'
import JobBasicInfo from './components/JobBasicInfo'
import JobCountInfo from './components/JobCountInfo'
import JobCompanyInfo from './components/JobCompanyInfo'
import JobContent from './components/JobContent'
import JobPosition from './components/JobPosition'
import JobBottom from './components/JobBottom'
import JobWarn from './components/JobWarn'
import JobBossInfo from './components/jobBossInfo'
import Companyinfo from './components/Companyinfo'
import CustomImage from 'src/components/image/CustomImage'
import CustomButton from 'src/components/button/CustomButton'
import { TabView, SceneMap } from 'react-native-tab-view'
import {
  cancelCollectionPost,
  collectionPost,
  getPostDetail,
  myCompanyBaseInfo,
  talentTalk,
  sharePost,
  blackPost
} from 'src/utils/RequestAPI'
import IMController from 'src/utils/IMController'
import { CommonToast } from 'src/utils/ToastUtil'
import CollectionBtn from 'src/components/button/CollectionBtn'
import { generateFuzzyQuery } from 'src/utils/FuzzyQueryUtil'
import { isEnv } from 'src/config/index'
import { showTipModal } from 'src/utils/ModalUtil'
import { DismissLoading, ShowLoading } from '../../../utils/ToastUtil'
import { shareToWXMiniProgram } from 'src/utils/PayUtil'
import ShareBtn from 'src/components/button/ShareBtn'
import BlockBtn from 'src/components/button/BlockBtn'
import NavigationUtil from 'src/utils/NavigationUtil'
import { fixImageUrls } from 'src/utils/ConfigUtil'

let jobDetailMounted = false
const mapActiontoProps = dispatch => ({
  initState() {
    dispatch({
      type: INIT_JOB_DETAIL_TYPE
    })
  },
  updateState(payload) {
    dispatch({
      type: UPDATE_JOB_DETAIL_TYPE,
      payload: {
        ...payload
      }
    })
  },
  doRequestJobDetail(...payload) {
    const promise = DO_REQUEST_JOB_DETAIL_ACTION(...payload)
    dispatch(promise)
    return promise.payload
  },
  doRequestJobCollect(...payload) {
    const promise = DO_REQUEST_JOB_COLLECT_ACTION(...payload)
    dispatch(promise)
    return promise.payload
  },
  doRequestJobUnCollect(...payload) {
    const promise = DO_REQUEST_JOB_UNCOLLECT_ACTION(...payload)
    dispatch(promise)
    return promise.payload
  },
  updatePositionDistance(payload) {
    dispatch({
      type: UPDATE_POSITION_DISTANCE_TYPE,
      payload: {
        ...payload
      }
    })
  },
  updatePositionMap(payload) {
    dispatch({
      type: UPDATE_POSITION_DISTANCE_TYPE,
      payload: {
        ...payload
      }
    })
  },
  updateImState(payload) {
    dispatch({
      type: UPDATE_IM,
      payload: {
        ...payload
      }
    })
  }
})

@connect(
  ({ userinfo, landmark, jobDetailStore, im, CMineCenterStore }) => ({
    userinfoC: userinfo.C,
    roleC: userinfo.role === 'C',
    userinfo,
    landmark,
    ...jobDetailStore,
    ...im,
    myCenterNumbers: CMineCenterStore.myCenterNumbers,
    CMineCenterStore
  }),
  mapActiontoProps
)
class CJobdetail extends BasePage {
  constructor(props) {
    super(props)
    const { navigation: { state: { params: { showCommunicate = true } = {} } } } = this.props
    this.state = {
      header: {},
      jobDetail: {},
      collectionId: null,
      showMap: false,
      scrollY: new Animated.Value(1),
      showCommunicate,
      isPost: true,
      index: 0,
      isLivePost: false,
      routes: [
        {
          key: 'first',
          title: ''
        },
        { key: 'second', title: '' }
      ],
      isShowBotton: false,
      logoShow: false
    }
    this.logoAnimatedValue = new Animated.Value(0)
    this.mapShowTimer = null
  }

  componentWillUnmount() {
    super.componentWillUnmount()
    clearTimeout(this.mapShowTimer)
  }

  componentDidFocus() {
    if (!jobDetailMounted) {
      this.initDatas()
      jobDetailMounted = true
    }
  }

  componentWillFocus() {
    ShowLoading()
    if (jobDetailMounted) {
      this.initDatas()
    }
  }

  _renderTabBar = props => {
    const inputRange = props.navigationState.routes.map((x, i) => i)
    return (
      <View>
        {props.navigationState.routes.map((route, i) => {
          return (
            <TouchableOpacity
              key={i}
              onPress={() => this.setState({ index: i })}
            >
            </TouchableOpacity>
          )
        })}
      </View>
    )
  }

  renderScene = ({ route }) => {
    const {
      positionActive,
      landmark: { cityName, currentLocation },
      roleC
    } = this.props
    const { jobDetail = {}, size, showMap, showCommunicate, isPost, isShowBotton, collectionId, logoShow, isLivePost } = this.state
    const { basicInfo, count, companyInfo, postWorkLocations, bossInfo, collectionCount } = jobDetail
    switch (route.key) {
      case 'first':
        return (
          <View>
            {!!basicInfo && (
              <JobWarn jobDetail={jobDetail} reportClick={this.reportClick} />
            )}
            {!!basicInfo && <JobContent postWorkLocations={postWorkLocations} data={basicInfo} />}
            {showMap && !!postWorkLocations &&
              (postWorkLocations.length > 0 ? (
                <JobPosition
                  // showMap={showMap}
                  data={postWorkLocations}
                  positionActive={positionActive}
                  currentLocation={currentLocation}
                  positionIndexClick={this.positionIndexClick}
                  positionNaviClick={this.positionNaviClick}
                  positionCurrentClick={this.positionCurrentClick}
                />
              ) : (
                  <View style={styles.jobPosition}>
                    <View style={styles.titleCont}>
                      <Text style={styles.title}>工作地点</Text>
                      <Text
                        style={styles.noJobPosition}
                      >{`该岗位在${cityName}没有工作地址`}</Text>
                    </View>
                  </View>
                ))}
          </View>
        )
      case 'second':
        return (<Companyinfo currentLocation={currentLocation} data={jobDetail} />)
      default:
        return null
    }
  }

  initDatas = () => {
    InteractionManager.runAfterInteractions(() => {
      const {
        landmark: { cityName },
        navigation: {
          state: {
            params: { id, isLivePost = false }
          }
        }
      } = this.props
      this.setState({
        isLivePost
      })
      this.jobDetailId = id
      if (this.jobDetailId) {
        getPostDetail({
          params: {
            postId: this.jobDetailId
          }
        })
          .then(data => {
            const jobDetail = data.data
            if (jobDetail && jobDetail.basicInfo) {
              jobDetail.basicInfo.isFast = jobDetail.isFast
            }
            // 过滤地址
            if (
              jobDetail &&
              jobDetail.basicInfo &&
              jobDetail.postWorkLocations &&
              jobDetail.postWorkLocations.length > 0
            ) {
              const cityReg = generateFuzzyQuery(cityName)
              jobDetail.postWorkLocations = jobDetail.postWorkLocations.reduce(
                (workLocations, currentValue) => {
                  if (
                    cityReg.test(currentValue.cityName) ||
                    cityReg.test(currentValue.address)
                  ) {
                    // 如果城市或者地址里面包含当前的位置，就选中
                    workLocations.push(currentValue)
                  }
                  return workLocations
                },
                []
              )
              jobDetail.basicInfo.areaNames =
                jobDetail.postWorkLocations.length > 0
                  ? [jobDetail.postWorkLocations[0].areaName]
                  : []
            }
            if (jobDetail) {
              jobDetail.count = {}
              jobDetail.count.viewCount = jobDetail.viewCount
              jobDetail.count.resumeCount = jobDetail.resumeCount
              jobDetail.count.entryCount = jobDetail.entryCount
              jobDetail.count.collectionCount = jobDetail.collectionCount
            }
            LayoutAnimation.easeInEaseOut()
            this.setState({
              jobDetail,
              collectionId: jobDetail.collectionId
            })
            return myCompanyBaseInfo({
              headers: { companyId: jobDetail.companyId }
            })
          })
          .then(datas => {
            let size = 0
            const data = datas.data
            data.addressDetail && ++size
            data.companyInfo && ++size
            data.companyAbout && ++size
            data.companyFinance && ++size
            data.companyPerson && ++size
            this.setState({
              size
            })
          })
          .finally(() => {
            const { jobDetail } = this.state
            this.createWyAccount(jobDetail)
            DismissLoading()
            if (!this.state.showMap) {
              this.mapShowTimer = setTimeout(() => {
                this.setState({ showMap: true })
                this.mapShowTimer && clearTimeout(this.mapShowTimer)
              }, 500)
            }
          })
      } else {
        const {
          navigation: {
            state: {
              params: { item }
            }
          }
        } = this.props
        item.basicInfo.areaNames =
          item.postWorkLocations.length > 0
            ? [item.postWorkLocations[0].areaName]
            : []
        item.basicInfo.isFast = item.isFast
        LayoutAnimation.easeInEaseOut()
        this.setState({
          jobDetail: item,
          collectionId: item.collectionId
        })
        DismissLoading()
        if (!this.state.showMap) {
          this.mapShowTimer = setTimeout(() => {
            this.setState({ showMap: true })
            this.mapShowTimer && clearTimeout(this.mapShowTimer)
          }, 500)
        }
      }
      this.setState({
        didMount: true
      })
    })
  }

  isShowBotton = (event) => {
    if (event.nativeEvent.contentOffset.y > 250) {
      if (!this.state.isShowBotton) {
        this.setState({
          isShowBotton: true
        })
      }
    } else {
      if (this.state.isShowBotton) {
        this.setState({
          isShowBotton: false
        })
      }
    }
  }

  _onScrollEndDrag = (event) => {
    // this.setState({
    //   scrollBeginState: false
    // })
    this._onMomentumScrollEnd(event)
  }

  _onMomentumScrollEnd = event => {
    const { logoShow } = this.state
    const {
      contentOffset: { y = 0 } = {},
      contentSize: { height: contentSizeHeight },
      layoutMeasurement: { height: oriageScrollHeight }
    } = event.nativeEvent
    if (y + oriageScrollHeight < contentSizeHeight - 10 && logoShow) {
      this.hideLogo()
    } else if (y + oriageScrollHeight >= contentSizeHeight - 10 && !logoShow) {
      this.setState({
        logoShow: true
      })
      this.showLogo()
    }
  }

  hideLogo = () => {
    // 隐藏底部按钮上面的图片
    this.logoAnimatedValue.setValue(1)
    Animated.timing(this.logoAnimatedValue, {
      toValue: 0,
      duration: 500,
      easing: Easing.ease
    }).start(() => {
      this.setState({
        logoShow: false
      })
    })
  }

  showLogo = () => {
    // 展示底部按钮上面的图片
    this.logoAnimatedValue.setValue(0)
    Animated.timing(this.logoAnimatedValue, {
      toValue: 1,
      duration: 500,
      easing: Easing.ease
    }).start()
  }

  childRender() {
    const {
      positionActive,
      landmark: { cityName, currentLocation },
      roleC
    } = this.props
    const { jobDetail = {}, size, showMap, showCommunicate, isPost, isShowBotton, collectionId, logoShow, isLivePost } = this.state
    const { basicInfo, count, companyInfo, postWorkLocations, bossInfo, collectionCount } = jobDetail
    if (!basicInfo) {
      return null
    }
    return (
      <View style={styles.container}>
        <Animated.ScrollView
          onScrollBeginDrag={this.onContentSizeChange}
          style={styles.scrollview}
          stickyHeaderIndices={[1]}
          onScrollEndDrag={this._onScrollEndDrag}
          showsVerticalScrollIndicator={false}
          onScroll={Animated.event(
            [
              {
                nativeEvent: { contentOffset: { y: this.state.scrollY } }
              }
            ],
            {
              listener: (event) => {
                this.isShowBotton(event)
              },
              useNativeDriver: IS_IOS
            }
          )}
        >
          {!!bossInfo &&
            <JobBossInfo
              isSendResume={jobDetail.isSendResume}
              isLivePost={isLivePost}
              onCollected={this._onCollected} collectionId={collectionId} chatClick={this.chatClick}
              data={bossInfo} collectionCount={collectionCount} />}
          <View ref='tabView' style={styles.tab}>
            <View style={styles.tabViewLeft}>
              <CustomButton params={1} onPress={this.isPostFn} style={styles.tabViewLeftposition}><Text
                style={[isPost && styles.textColorTow, !isPost && styles.textColor]}>职位</Text><Text
                  style={styles.tabViewLeftpositionText}></Text></CustomButton>
              <CustomButton params={2} onPress={this.isPostFn} style={styles.tabViewLeftcompany}><Text
                style={[!isPost && styles.textColorTow, isPost && styles.textColor]}>企业</Text></CustomButton>
            </View>
            <View style={styles.tabViewRight}><Text style={styles.tabViewRightText}>其他职位·{(companyInfo || {}).postCount > 0 ? (companyInfo || {}).postCount - 1 : 0}</Text><CustomImage style={styles.triangle} source={require('src/imgC/post/triangle.png')}></CustomImage></View>
          </View>
          {/* {!!basicInfo && <JobBasicInfo data={basicInfo} />} */}
          {/* {!!count && <JobCountInfo data={count} />} */}
          {/* <JobAlumnuInfo/> */}
          {/* {!!companyInfo &&
            Object.keys(companyInfo).length > 0 && (
              <JobCompanyInfo
                size={size}
                data={companyInfo}
                onPress={this._jobCompanyInfoPress}
              />
            )} */}
          <TabView
            navigationState={this.state}
            // renderScene={SceneMap({
            //   first: firstRoute,
            //   second: secondRoute,
            //   secondRoutes: secondRoutes
            // })}
            renderScene={this.renderScene}
            renderTabBar={this._renderTabBar}
            onIndexChange={index => this.setState({ index, isPost: !this.state.isPost })}
            initialLayout={{ width: Dimensions.get('window').width }}
          />
        </Animated.ScrollView>
        {showCommunicate && roleC && isShowBotton && (<JobBottom isSendResume={jobDetail.isSendResume} isLivePost={isLivePost} logoShow={logoShow} logoAnimatedValue={this.logoAnimatedValue} data={bossInfo} chatClick={this.chatClick} />)}
      </View>
    )
  }

  /**
   * 公司信息
   * @param companyInfo
   * @private
   */
  _jobCompanyInfoPress = companyInfo => {
    if (this.state.size == 5) {
      this.props.navigation.navigate('CompanyHomepage', {
        companyId: companyInfo.companyId
      })
    }
  }

  renderNavigationBarChild = () => {
    const {
      jobDetail: { bossInfo: { avator } = {} },
      collectionId,
      scrollY
    } = this.state
    const {
      navigation: {
        state: {
          params: { blockCallback }
        }
      },
      roleC
    } = this.props
    return (
      <Fragment>
        <Animated.Image
          numberOfLines={1}
          style={[
            styles.navigationTitle,
            {
              opacity: scrollY.interpolate({
                inputRange: [0, 89, 90],
                outputRange: [0, 0, 1]
              })
            }
          ]}
          source={{ uri: fixImageUrls(avator) }}
        >
        </Animated.Image>
        {!!this.jobDetailId && roleC && (
          <View style={styles.navigationBar}>
            {blockCallback && <BlockBtn onPress={this._onBlockClick} />}
            <ShareBtn onPress={this._onSharedClick} />
            {/* <CollectionBtn
              isCollected={!!collectionId}
              onCollected={this._onCollected}
            /> */}

          </View>
        )}
      </Fragment>
    )
  }

  _onSharedClick = () => {
    const { jobDetail = {} } = this.state
    const { count, basicInfo: { name: title } = {}, companyId, id } = jobDetail
    if (id && companyId && title) {
      shareToWXMiniProgram({
        title,
        shareUrl: `pages/job-detail/index?id=${id}&companyId=${companyId}&share=app`
      })
        .then(() => {
          return sharePost({ params: { id } })
        })
        .then(res => {
          CommonToast(res.data)
          this.setState({
            jobDetail: {
              ...jobDetail,
              count: {
                ...count,
                entryCount: count.entryCount + 1
              }
            }
          })
        })
    }
  }

  _onCollected = isCollected => {
    if (this._loginJump()) {
      return
    }
    if (isCollected) {
      this.unFavoriteClick()
    } else {
      this.favoriteClick()
    }
  }

  favoriteClick = () => {
    if (this.props.roleC) {
      const { jobDetail } = this.state
      const { userinfoC } = this.props
      collectionPost({
        params: {
          postId: jobDetail.id,
          userId: userinfoC.userId
        }
      }).then(data => {
        const item = this.state.jobDetail
        item.collectionCount = item.collectionCount + 1
        this.setState({
          jobDetail: item
        })
        CommonToast('关注成功')
        this.setState({
          collectionId: data.data
        })
      })
    }
  }

  unFavoriteClick = () => {
    if (this.props.roleC) {
      const { collectionId } = this.state
      cancelCollectionPost({
        params: {
          ids: collectionId.toString()
        }
      }).then(data => {
        const item = this.state.jobDetail
        item.collectionCount = item.collectionCount - 1
        this.setState({
          jobDetail: item
        })
        CommonToast('取消关注成功')
        this.setState({
          collectionId: null
        })
      })
    }
  }

  _onBlockClick = () => {
    if (this._loginJump()) {
      return
    }
    const onConfirm = () => {
      const {
        navigation: {
          state: {
            params: { blockCallback, id: postId }
          }
        }
      } = this.props
      blackPost({ params: { postId } }).then(() => {
        blockCallback()
        this.tipPrompModal.close(() => {
          this.goBack()
          this.tipPrompModal = null
        })
      })
    }
    this.tipPrompModal = showTipModal({
      titleText: '屏蔽提示',
      contentText: '是否要屏蔽该岗位？屏蔽后该岗位将不再显示',
      confirmText: '确定',
      onCancel: () => {
        this.tipPrompModal.close()
      },
      onConfirm
    })
  }

  reportClick = () => {
    if (this.state.jobDetail.isReport === 0) {
      const {
        navigation: {
          state: {
            params: { id }
          }
        }
      } = this.props
      this.jobDetailId = id
      if (this.state.jobDetail) {
        !this._loginJump() &&
          this.props.navigation.navigate('CompanyReport', {
            jobDetailId: id
          })
      } else {
        CommonToast('未获取到企业信息跳转举报页面失败')
      }
    }
  }

  positionIndexClick = positionActive => {
    this.props.updateState({
      positionActive,
      currentLocation: null
    })
  }

  positionNaviClick = () => {
  }

  positionCurrentClick = () => {
    getCurrentPosition().then(currentLocation => {
      this.props.updateState({
        currentLocation
      })
    })
  }

  chatClick = (type) => {
    const { jobDetail, isLivePost } = this.state
    if (jobDetail.bossInfo) {
      if (this._loginJump()) {
        return
      }
      const { roleC } = this.props
      if (roleC) {
        if (!isLivePost || type === 1) {
          this._archiveJump().then(() => {
            const { userinfoC } = this.props
            // TODO: 现在是直接沟通  后续需要记录到沟通历史
            const { selToID } = this.props
            if (selToID) {
              this.props.updateImState({
                msgArray: []
              })
              ShowLoading()
              talentTalk({
                params: {
                  type: 'C',
                  cmpUserId: userinfoC.userId,
                  postId: jobDetail.id,
                  companyId: jobDetail.companyId,
                  userId: jobDetail.bossInfo.userId
                }
              }).then(() => {
                DismissLoading()
                NavigationUtil.navigate('ChatPage')
              }).catch(() => {
                DismissLoading()
              })
            } else {
              CommonToast('这个岗位没有负责人')
            }
          })
        } else {
          console.log(jobDetail)
          if (jobDetail.isSendResume) {
            CommonToast('该岗位您已投递')
          } else {
            NavigationUtil.navigate('ThrowResume', {
              companyId: 1,
              postId: this.jobDetailId,
              channelId: this.props.navigation.state.params.channelId
            })
          }
        }
      }
    }
  }

  _archiveJump = () => {
    // 根据该用户建立完成度判断跳转
    return new Promise((resolve, reject) => {
      const {
        CMineCenterStore: {
          jobHuntingModels = [],
          intro,
          educations = [],
          userArchiveWorkModels = []
        }
      } = this.props
      if (jobHuntingModels.length === 0) {
        const modal = showTipModal({
          titleText: '温馨提示',
          contentText: '您的求职意愿信息不完善，无法进行沟通，快去完善简历吧',
          confirmText: '去完善',
          cancelText: '取消',
          onConfirm: () => {
            this.props.navigation.navigate('CFirstUserInfo', {
              fromJobdetail: true
            })
            modal.close()
          },
          onCancel: () => {
            modal.close()
          }
        })
        reject()
        return
      }
      if (!intro) {
        const modal = showTipModal({
          titleText: '温馨提示',
          contentText: '您的自我评价信息不完善，无法进行沟通，快去完善简历吧',
          confirmText: '去完善',
          cancelText: '取消',
          onConfirm: () => {
            this.props.navigation.navigate('CFirstUserInfo', {
              fromJobdetail: true
            })
            modal.close()
          },
          onCancel: () => {
            modal.close()
          }
        })
        reject()
        return
      }
      if (educations.length === 0 && userArchiveWorkModels.length === 0) {
        const modal = showTipModal({
          titleText: '温馨提示',
          contentText: '您的教育信息不完善，无法进行沟通，快去完善简历吧',
          confirmText: '去完善',
          cancelText: '取消',
          onConfirm: () => {
            this.props.navigation.navigate('CEducationInfoManager')
            modal.close()
          },
          onCancel: () => {
            modal.close()
          }
        })
        reject()
        return
      }
      resolve()
    })
  }

  createWyAccount = jobDetail => {
    // 创建网易云信账号
    const {
      bossInfo,
      companyId,
      companyInfo: { companyName = '', simpleName = '' }
    } = jobDetail
    const identifier = bossInfo.userId + 'b' + isEnv
    const newCompanyName = simpleName || companyName
    const userInfo = {
      userName: bossInfo.userName,
      userAvator: bossInfo.avator,
      userId: bossInfo.userId,
      gender: bossInfo.sex,
      mobile: bossInfo.mobile
    }
    if (bossInfo.userId) {
      IMController.createAccount({
        userId: identifier,
        role: 'B',
        userInfo,
        companyName: newCompanyName,
        companyId
      }).then(() => {
      })
    }
  }

  _loginJump = () => {
    const {
      userinfo: { userId, C: { userId: userIdC } = {} }
    } = this.props
    if (!userId) {
      this.props.navigation.navigate('OneLogin')
      return true
    }
    if (!userIdC) {
      this.props.navigation.navigate('CFirstUserInfo', {
        fromJobdetail: true
      })
      return true
    }
  }

  isPostFn = (type) => {
    this.setState({
      isPost: type === 1,
      index: type === 1 ? 0 : 1
    })
  }
}

export default CJobdetail

const styles = StyleSheet.create({
  container: {
    flex: 1
  },
  scrollview: {
    flex: 1
  },
  navigationBar: {
    position: 'absolute',
    right: ScaleS(5),
    top: 0,
    height: '100%',
    flexDirection: 'row',
    justifyContent: 'center',
    alignItems: 'center'
  },
  navigationTitle: {
    width: ScaleS(30),
    height: ScaleS(30),
    borderRadius: ScaleS(15)
  },
  naviBtnBG: {
    marginLeft: ScaleS(8),
    width: ScaleS(58),
    height: ScaleS(28),
    backgroundColor: '#F5F5F5',
    borderRadius: ScaleS(14),
    justifyContent: 'center',
    alignItems: 'center'
  },
  naviBtnLinearGradient: {
    width: '100%',
    height: '100%',
    justifyContent: 'center',
    alignItems: 'center',
    borderRadius: ScaleS(14)
  },
  jobPosition: {
    marginTop: ScaleS(30)
  },
  titleCont: {
    paddingHorizontal: ScaleS(20),
    // flexDirection: 'row',
    alignItems: 'flex-start',
    marginBottom: ScaleS(20)
  },
  title: {
    marginLeft: ScaleS(2),
    fontSize: ScaleT(25),
    color: '#000000',
    fontWeight: '500',
    lineHeight: ScaleS(35),
    height: ScaleS(35)
  },
  noJobPosition: {
    // marginLeft: ScaleS(6),
    marginTop: ScaleS(20)
  },
  tab: {
    paddingTop: ScaleS(16),
    paddingBottom: ScaleS(24),
    backgroundColor: '#fff',
    paddingHorizontal: ScaleS(20),
    overflow: 'hidden'
  },
  tabViewLeft: {
    flexDirection: 'row'
  },
  tabViewRight: {
    position: 'absolute',
    right: 0,
    flexDirection: 'row',
    alignItems: 'center'
  },
  tabViewLeftpositionText: {
    marginLeft: ScaleS(20),
    width: ScaleS(1),
    height: ScaleS(10),
    backgroundColor: 'rgba(151, 151, 151, 1)'
  },
  tabViewLeftposition: {
    alignItems: 'center',
    flexDirection: 'row',
    fontSize: ScaleS(13)
  },
  tabViewLeftcompany: {
    alignItems: 'center',
    flexDirection: 'row',
    fontSize: ScaleS(13),
    paddingHorizontal: ScaleS(20)
  },
  tabViewRightText: {
    color: 'rgba(204, 204, 204, 1)'
  },
  textColorTow: {
    color: 'rgba(60, 60, 60, 1)',
    fontWeight: '900'
  },
  textColor: {
    color: 'rgba(153, 153, 153, 1)'
  },
  triangle: {
    width: ScaleS(4),
    height: ScaleS(6),
    marginLeft: ScaleS(6)
  }
})
// https://github.com/Micjoyce/ScrollViewWithTabView
